#!/usr/bin/python

def normalize(s):
    index = s.find('&')
    if (index >= 0):
        left = s[0:index]
        right = s[index+1:]
        left = left.strip()
        right = right.strip()
        s = left + " and " + right
        return s
    index = s.find('/')
    if (index >= 0):
        left = s[0:index]
        right = s[index+1:]
        left = left.strip()
        right = right.strip()
        s = left + " or " + right
        return s
    start = s.find('(')
    if start >= 0:
        end = s.find(')')
        left = s[0:start]
        bracket = s[start+1:end]
        left = left.strip()
        bracket = bracket.strip()
        s = bracket + " " + left
        return s
    s = s.strip()
    return s


reader = open('purposes', 'r')
writer = open('purposes.lower', 'w')
while True:
    line = reader.readline()
    if line == '':
        break
    if line[-2:-1] == '.':
        line = line[0:-2]
    else:
        line = line[0:-1]
    line = line.lower()
    line = normalize(line)
    writer.write(line)
    writer.write('\n')
writer.close()
reader.close()
